[23기_김동욱] 성능최적화 미션 제출합니다.#69
Open
boogiewooki02 wants to merge 3 commits into
Open
Conversation
Seungwon326
reviewed
May 24, 2026
Comment on lines
+975
to
+983
| | 전파 속성 | 설명 | 사용 예시 | | ||
| | --- | --- | --- | | ||
| | `REQUIRED` | 기존 트랜잭션이 있으면 참여하고, 없으면 새로 생성한다. 기본값이다. | 일반적인 서비스 계층의 저장/수정 로직 | | ||
| | `REQUIRES_NEW` | 항상 새로운 트랜잭션을 생성한다. 기존 트랜잭션은 잠시 중단된다. | 감사 로그 저장, 실패 이력 저장처럼 본 작업과 독립적으로 커밋해야 하는 로직 | | ||
| | `SUPPORTS` | 기존 트랜잭션이 있으면 참여하고, 없으면 트랜잭션 없이 실행한다. | 트랜잭션이 필수는 아닌 조회 로직 | | ||
| | `NOT_SUPPORTED` | 트랜잭션 없이 실행한다. 기존 트랜잭션이 있으면 잠시 중단한다. | 외부 API 호출, 긴 네트워크 I/O | | ||
| | `MANDATORY` | 반드시 기존 트랜잭션이 있어야 한다. 없으면 예외가 발생한다. | 상위 서비스 트랜잭션 내부에서만 호출되어야 하는 내부 메서드 | | ||
| | `NEVER` | 트랜잭션이 있으면 예외가 발생한다. | 트랜잭션 안에서 실행되면 안 되는 작업 | | ||
| | `NESTED` | 기존 트랜잭션 내부에 savepoint를 만들고 중첩 트랜잭션처럼 동작한다. | 일부 작업만 롤백하고 전체 트랜잭션은 유지해야 하는 경우 | |
Comment on lines
+1019
to
+1026
| 이 구조는 다음 문제가 있습니다. | ||
|
|
||
| - 외부 결제 API 응답이 늦어지면 DB 트랜잭션과 커넥션이 오래 점유된다. | ||
| - 외부 결제는 성공했지만 DB 커밋이 실패하면 결제 상태와 예약 상태가 불일치할 수 있다. | ||
| - 외부 API는 DB 트랜잭션으로 롤백할 수 없기 때문에 트랜잭션 범위에 포함하는 것이 적절하지 않다. | ||
|
|
||
| ### 개선 방향 | ||
|
|
Comment on lines
+1221
to
+1223
|
|
||
| `reserved_seat`는 좌석 단위로 데이터가 쌓이기 때문에 예약 ID 기준의 count/delete가 반복되면 전체 스캔 비용이 커질 수 있습니다. `res_id` 인덱스를 추가해 특정 예약에 연결된 좌석만 빠르게 찾도록 개선했습니다. | ||
|
|
There was a problem hiding this comment.
최적화를 통해 시간이 얼마나 감소했는지도 최적화 전/후를 비교해서 알려주시면 좋을거같습니다!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.